package com.klun.designMode.flyweight;

/**
 * 具体享元角色类
 */
public class ConcreateFlyweight implements Flyweight {

    private Character intrinsicState = null;

    /**
     * 构造函数，内蕴状态作为参数传入
     * @param state
     */
    public ConcreateFlyweight(Character state) {
        this.intrinsicState = state;
    }

    /**
     * 外蕴状态作为参数传入方法中，改变方法的行为
     * @param state
     */
    @Override
    public void operation(String state) {
        System.out.println("Intrinsic state = " + this.intrinsicState);
        System.out.println("Extrinsic state = " + state);
    }
}
